import { createApp } from 'vue';
import './style.css';//基础样式
import 'github-markdown-css';
/**Element-Plus */
import ElementPlus from 'element-plus';
import 'element-plus/dist/index.css';
import router from './router/index.js';
import App from './App.vue'
import { ElMessage } from 'element-plus';



router.beforeEach((to, from, next) => {
    const token = localStorage.getItem('matrix-token');
    if (!token && to.path != '/login'){
      ElMessage.error('请先登录!');
      next({ name: 'login' });
    }
    next();
  });

const app = createApp(App);


app.use(router);//路由

app.use(ElementPlus);//Element-Plus

app.mount('#app');
